package bsw.wode.user.action;

import bsw.wode.action.BaseAction;
import bsw.wode.config.ActionConstant;
import bsw.wode.entity.WodeUser;
import bsw.wode.service.RegisterService;

public class RegisterAction extends BaseAction {

	private static final long serialVersionUID = -3009601593686851704L;

	private WodeUser newUser;
	private String confirmPassword;
	
	public String execute() throws Exception {
		
		newUser.setLastLoginIp(null);
		newUser.setLastLoginTime(null);
		
		RegisterService service = new RegisterService();
		
		if(service.registerService(newUser))
		{
			return ActionConstant.FAILURE;
		}
		
		return ActionConstant.SUCCESS;
	}

	public WodeUser getNewUser() {
		return newUser;
	}

	public void setNewUser(WodeUser newUser) {
		this.newUser = newUser;
	}

	public String getConfirmPassword() {
		return confirmPassword;
	}

	public void setConfirmPassword(String confirmPassword) {
		this.confirmPassword = confirmPassword;
	}
	


}
